Fix warning CA1062#ContextualTtl#2217
Merged
martincostello merged 1 commit intoApp-vNext:mainfrom Jul 20, 2024
Merged
Conversation
Zombach
commented
Jul 20, 2024
| /// <returns>TimeSpan.</returns> | ||
| public Ttl GetTtl(Context context, object? result) | ||
| { | ||
| if (context is null) |
Contributor
Author
There was a problem hiding this comment.
@martincostello
Which is better to use? == or the pattern is
The is mapping pattern, but mostly the code uses ==
Member
There was a problem hiding this comment.
I would use is for new code where it is equivalent to == null. Don't worry about updating existing code to match - it was written before is was a thing.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2217 +/- ##
=======================================
Coverage 83.89% 83.90%
=======================================
Files 313 313
Lines 7179 7181 +2
Branches 1060 1061 +1
=======================================
+ Hits 6023 6025 +2
Misses 785 785
Partials 371 371
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
martincostello
approved these changes
Jul 20, 2024
26 tasks
This was referenced Jul 30, 2025
This was referenced Aug 26, 2025
This was referenced Sep 29, 2025
This was referenced Dec 8, 2025
This was referenced Dec 15, 2025
This was referenced Jan 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
The issue or feature being addressed
#2215
Details on the issue fix or feature implementation
Confirm the following